package cn.com.jslh.boarpro.main.model;

import android.content.Context;

import java.util.List;

import cn.com.jslh.boarpro.base.mvp.BaseListModel;
import cn.com.jslh.boarpro.util.WebService;

/**
 * 作者：周洲 on 2017/7/31 08:46
 * <p>
 * 邮箱：double0zhou@126.com
 */

public class InfoShowModelImpl extends BaseListModel {
    public InfoShowModelImpl(Context context) {
        super(context);
    }

    @Override
    public List<?> getDatas(String... params) {
        return null;
    }


    /**
     * 根据耳号获取猪信息
     *
     * @param type
     * @param nListener
     * @param params
     */
    public void getAsyncMuZhuDatas(String type, WebService.NetSuccessListener nListener, String... params) {
        switch (type) {
            case "MuZhuType":
                new WebService.Builder(context, "exportPZSowData", "WSSowFacade")//exportMuZhuData //配种母猪
                        .showDialog(true)
                        .addProperty("erHao", params[1])
                        .addProperty("lineID", params[2])
                        .success(nListener)
                        .post();
                break;

            case "GongZhuType":
                new WebService.Builder(context, "exportPZBoarData", "WSSowFacade") //exportGongZhuData //配种公猪
                        .addProperty("erHao", params[1])
                        .showDialog(true)
                        .success(nListener)
                        .post();
                break;

            case "FenMianType"://分娩母猪耳号
                new WebService.Builder(context, "exportFMSowData", "WSSowFacade") //exportGongZhuData //分娩母猪
                        .addProperty("erHao", params[1])
                        .addProperty("lineID", params[2])
                        .addProperty("zhuSheID", params[3])
                        .showDialog(true)
                        .success(nListener)
                        .post();
                break;
            case "DuanNaiType"://断奶母猪耳号
                new WebService.Builder(context, "exportDNSowData", "WSSowFacade") //exportGongZhuData //分娩母猪
                        .addProperty("erHao", params[1])
                        .addProperty("lineID", params[2])
                        .success(nListener)
                        .showDialog(true)
                        .post();
                break;
        }

    }
}
